<template>
	<view>
		<view class="flex-row-space-between" style="height: 108rpx;margin: 0 30rpx;">
			<view class="flex-row-flex-start">
				<view @click="handleLocation()" class="city flex-row-flex-start">
					{{city}}
					<image class="image2" src="/static/index/2.png" mode=""></image>
				</view>
				<input type="text"  :placeholder="placeholder">
			</view>
			<view @click="cancelClick()" class="cancel">
				取消
			</view>
		</view>
		<view class="line"></view>
		<view v-for="(item,index) in 11" :key="index">
			<view class="item">
				<view class="name">
					郑州新郑国际机场
				</view>
				<view class="address">
					郑州市航空港区迎宾大道
				</view>
			</view>
			<view class="line"></view>
		</view>
	</view>
</template>

<script>
	
	export default {
		components: {},
		computed: {

		},
		data() {
			return {
				city: '定位中...',
			type:0,
			placeholder:'请输入起点'
				
			}
		},
		onShow() {
			uni.$on("cityName", res => {
				this.city = res.city;
				// 清除监听
				uni.$off('cityName');
			})
		},
		onLoad(e) {
			if(e.type){
			this.type=Number(e.type)	
			}
			if(this.type){
				uni.setNavigationBarTitle({
					title:'终点'
				})
				this.placeholder='请输入目的地'
			}
		
			this.getLocation()
		},
		
		methods: {
			
			
			showToast(title){
				uni.showToast({
					title:title,
					icon:'none'
				})
			},
			cancelClick(){
			uni.navigateBack()	
			},
			handleLocation() {
				uni.navigateTo({
					url: '/pages/index/city'
				})
			},
			clickLeft(){
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
	.city{
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #333333;
	}
.image2 {
		margin-left: 6rpx;
		margin-right: 26rpx;
		width: 12rpx;
		height: 12rpx;
		
	}
	input{
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #333333;
	}
	.cancel{
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;
	}
	.line{
		height: 2rpx;
		background: #F5F6F7;
	}
	.name{
		margin-top: 26rpx;
		margin-left: 30rpx;
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #333333;
	}
	.address{
		margin-top: 10rpx;
		margin-left: 30rpx;
		margin-bottom: 26rpx;
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;
	}
</style>
